package com.sc.nft.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;

import com.sc.nft.enums.SaasTaskConfigurationEnum;
import com.sc.nft.enums.SaasTaskRestEnum;
import com.sc.nft.enums.SaasTaskStatusEnum;
import com.sc.nft.enums.SaasTaskTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
@Data
public class SaasTaskVO {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "任务名字")
    private String taskName;

    @ApiModelProperty(value = "任务icon")
    private String taskIcon;

    @ApiModelProperty(value = "任务类型描述")
    private String taskTypeName;

    @ApiModelProperty(value = "任务重置类型")
    private SaasTaskRestEnum taskRest;

    @ApiModelProperty(value = "任务重置类型描述")
    private String taskRestName;

    @ApiModelProperty(value = "任务剩余数量")
    private Integer taskResidueSum;

    @ApiModelProperty(value = "任务完成总次数")
    private Integer taskTotalSum;

    @ApiModelProperty(value = "任务每个人最大完成上限")
    private Integer taskEveryoneSum;

    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date taskStart;

    @ApiModelProperty(value = "结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date taskEnd;

    @ApiModelProperty(value = "配置状态 1:未配置奖励  2:未提交审核 3:审核中 4:撤销审核 5: 审核未通过 6: 审核通过")
    private SaasTaskConfigurationEnum taskConfiguration;

    @ApiModelProperty(value = "配置状态描述 1:未配置奖励  2:未提交审核 3:审核中 4:撤销审核 5: 审核未通过 6: 审核通过")
    private String taskConfigurationName;

    @ApiModelProperty(value = "启用状态 1:启动 2:未启动")
    private SaasTaskStatusEnum taskStatus;

    @ApiModelProperty(value = "审核备注")
    private String taskRemark;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    public void setTaskType(SaasTaskTypeEnum taskType) {
        this.taskTypeName = taskType.getDesc();
    }

    public void setTaskRest(SaasTaskRestEnum taskRest) {
        this.taskRest = taskRest;
        this.taskRestName = taskRest.getDesc();
    }
    public void setTaskConfiguration(SaasTaskConfigurationEnum taskConfiguration) {
        this.taskConfiguration = taskConfiguration;
        this.taskConfigurationName = taskConfiguration.getDesc();
    }

}
